#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
期末周 - 网页版游戏启动器
"""

import sys
import os

# 添加项目根目录到Python路径
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, current_dir)

try:
    from web_app import app
    print("正在启动期末周网页版游戏...")
    print("请在浏览器中访问: http://localhost:5001")
    print("按 Ctrl+C 停止游戏")
    app.run(debug=True, host='0.0.0.0', port=5001)
except ImportError as e:
    print(f"导入错误: {e}")
    sys.exit(1)
except KeyboardInterrupt:
    print("\n游戏已停止")
    sys.exit(0)